package com.pes.arcww.service;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.pes.arcww.dao.ProfilesDAO;
import com.pes.arcww.form.Profiles;


@Service("profileService")
public class ProfilesServiceImpl implements ProfilesService {
	
	@Autowired
	private ProfilesDAO profileDAO;
	
	@Transactional
	public void addProfile(Profiles profile) {
		profileDAO.addProfile(profile);
	}
	
	@Transactional
	public void addTopic(Integer pro_id, Integer top_id) {
		profileDAO.addTopic(pro_id, top_id);
	}

	@Transactional
	public Collection<Profiles> listProfiles(String filter, String value) {
		return profileDAO.listProfiles(filter, value);
	}

	@Transactional
	public Profiles getProfile(Integer id) {
		return profileDAO.getProfile(id);
	}

	@Transactional
	public void removeProfile(Integer id) {
		profileDAO.removeProfile(id);
	}
	
	@Transactional
	public void removetopic(Integer pro_id, Integer top_id) {
		profileDAO.removetopic(pro_id, top_id);
	}

	@Transactional
	public void updateProfile(Profiles profile) {
		profileDAO.updateProfile(profile);
	}
}
